<?php
$url = $_SERVER['DOCUMENT_URI'];
$url = str_replace('/index.php/', '', $url);
$app = '';
if (strpos($url, '/') !== false) {
    preg_match('/(?!\/)(.*?)(?=\/)/', $url, $matches);
    $app = $matches[0];
} else {
    $app = empty($url) ? 'index' : $url;
}
define('BASE_PATH', ROOT_PATH . '/app/' . $app);
define("VIEW_PATH", BASE_PATH . '/views');
$app = new \Yaf\Application(ROOT_PATH . "/config/app.ini");
